OCRSetScale

Sets the scale of an image before reading it using OCR. Use to override the default OCR scale set in the playback options, which may help improve the accuracy of returned text. See Troubleshooting OCR issues.

Syntax

OCRSetScale(Scale)

Arguments

Argument Description
Scale Number of times larger than the original image size to increase the scale. Enter a value between 1 and 15. For example, 1 scales to original size (100%), 2 scales two times the original size (200%), and 15 scales 15 times the original size (1500%).

Example

'Saves default OCR settings

lang = OCRGetLanguageFilePath()

contrast = OCRGetContrast()

imgScale = OCRGetScale()

grayConversion = OCRIsConvertingToGrayscale()

Try

'Changes OCR settings for the checkpoint

OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata")

OCRSetContrast(50)

OCRSetScale(2)

OCRConvertToGrayscale(True)

'Verifies text in the page footer

Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect")

Finally

'Resets default OCR settings

OCRSetLanguageFilePath(lang)

OCRSetContrast(contrast)

OCRSetScale(imgScale)

OCRConvertToGrayscale(grayConversion)

End Try